/*
 * Copyright (c) 2015. For Intelligent Group.
 */

package com.intelligent.ispc.foundation.poi;

import org.apache.poi.xssf.usermodel.XSSFCellStyle;


/**
 * Created by cherry on 2016/4/20.
 */
public final class ExUtil {
    public static ExCell fillToCell(Integer[] coordinate, String value, ExCellType type, XSSFCellStyle style) {
        ExCell exCell = new ExCell();
        if (ExCellType.TEXT.equals(type)) {
            exCell.setCellType(ExCellType.TEXT);
        } else if (ExCellType.IMAGE.equals(type)) {
            exCell.setCellType(ExCellType.IMAGE);
        }
        exCell.setStyle(style);
        exCell.setCoordinate(coordinate);
        exCell.setValue(value);
        return exCell;
    }

    public static ExCell fillToCell(Integer[] coordinate, String value, ExCellType type) {
        return ExUtil.fillToCell(coordinate, value, type, null);
    }
}
